<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="keywords"/>
    <meta name="description"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"/>
    <link href="/css/userinfostyle.css" type="text/css" rel="stylesheet"/>
    <link href="/css/picstyle.css" tppabs="http://www.17sucai.com/preview/1268063/2018-10-23/Sunburn/css/style.css"
          rel="stylesheet" type="text/css"/>

    <link rel="stylesheet" href="/css/amazeui.min.css"/>
    <link rel="stylesheet" href="/css/amazeui.datetimepicker.css"/>
    <link rel="stylesheet" type="text/css" href="/css/aui.css"/>


    <script type="text/javascript" src="/js/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="/js/aui-dialog.js"></script>
    <style>
        .file {
            position: relative;
            display: inline-block;
            background: #D0EEFF;
            border: 1px solid #99D3F5;
            border-radius: 4px;
            padding: 4px 12px;
            overflow: hidden;
            color: #1E88C7;
            text-decoration: none;
            text-indent: 0;
            line-height: 20px;
        }

        .file input {
            position: absolute;
            font-size: 100px;
            right: 0;
            top: 0;
            opacity: 0;
        }

        .file:hover {
            background: #AADFFD;
            border-color: #78C3F3;
            color: #004974;
            text-decoration: none;
        }
    </style>
</head>
<body>
<header class="aui-bar aui-bar-nav" id="aui-header" onclick="goblack()">
    <a class="aui-btn aui-pull-left goblack">
        <span class="aui-iconfont aui-icon-left"></span>
    </a>
    <div class="aui-title">修改信息</div>
</header>
<iframe class="iframe" style="display:none;" src="dofileupdate" width="100%" height="100%">
    <p>您的浏览器不支持 iframe 标签。</p>
</iframe>
<form id="merchants" style="display:block;">
    <#if (Merchants)??>
    <#list Merchants as mer>
    <div class="aui-content aui-margin-b-15">
        <ul class="aui-list aui-form-list">
            <div class="aui-content aui-margin-b-15">
                <li class="aui-list-item">
                    <div class="aui-media-list-item-inner">
                        <div class="aui-list-item-media" style="width:6rem">
                            <#if mer.merchantsActiv!="">
                            <img class="img-clip" style="text-align:center;" src="/${mer.merchantsActiv}" width="150"
                                 height="100">
                            <#else>
                            <img class="img-clip" style="text-align:center;" src="/images/default_avatar.jpg"
                                 width="150" height="100">
                        </
                        #if>
                    </div>
                    <div class="aui-list-item-inner">
                        <div class="aui-layout">
                            <a href="#" class="acvfile">选择头像
                            </a>
                            <input type="hidden" class="avtiv" name="merchantsActiv">
                        </div>
                    </div>
            </div>
            </li>


    </div>

    <li class="aui-list-item">
        <div class="aui-list-item-inner">
            <div class="aui-list-item-label">
                店铺名称
            </div>
            <div class="aui-list-item-input">
                <input type="text" name="merchantsShopname" class="name-input" placeholder="${mer.merchantsShopname}"
                       value="${mer.merchantsShopname}"/>
            </div>
        </div>
    </li>

    <li class="aui-list-item">
        <div class="aui-list-item-inner">
            <div class="aui-list-item-label">
                手机号
            </div>
            <div class="aui-list-item-input">
                <input type="text" name="merchantsPhone" class="name-input phone"
                       style="margin-left: 1px;" placeholder="${mer.merchantsPhone}" value="${mer.merchantsPhone}"/>
            </div>
        </div>
    </li>
    <li class="aui-list-item">
        <div class="aui-list-item-inner">
            <div class="aui-list-item-label">
                热线电话
            </div>
            <div class="aui-list-item-input">
                <input type="text" name="merchantsHotlinepho" class="name-input"
                       style="margin-left: 1px;" placeholder="${mer.merchantsHotlinepho}"
                       value="${mer.merchantsHotlinepho}"/>
            </div>
        </div>
    </li>
    <li class="aui-list-item">
        <div class="aui-list-item-inner">
            <div class="aui-list-item-label">
                上班时间
            </div>
            <div class="aui-list-item-input">
                <input type="text" name="merchantsBusiness" value="${mer.merchantsBusiness}" id="datetimepicker1"
                       class="am-form-field">
            </div>
        </div>
    </li>
    <li class="aui-list-item">
        <div class="aui-list-item-inner">
            <div class="aui-list-item-label">
                下班时间
            </div>
            <div class="aui-list-item-input">
                <input type="text" name="merchantsEndtime" value="${mer.merchantsEndtime}" id="datetimepicker2"
                       class="am-form-field">
            </div>
        </div>
    </li>

    <li class="aui-list-item">
        <div class="aui-list-item-inner aui-list-item-center aui-list-item-btn">
            <input type="hidden" class="id" name="merchantsId" value="${mer.merchantsId}">
            <div class="aui-btn aui-btn-info aui-margin-r-5 subbtn">提交</div>
            <div class="aui-btn aui-btn-danger aui-margin-l-5">取消</div>
        </div>
    </li>
    </ul>
    </div>
</
#list>
</
#if>

</form>

<script type="text/javascript" src="/js/jquery-3.2.1.js"></script>
<script type="text/javascript" src="/js/jquery.min.js"
        tppabs="http://www.17sucai.com/preview/1268063/2018-10-23/Sunburn/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/stars.js"
        tppabs="http://www.17sucai.com/preview/1268063/2018-10-23/Sunburn/js/stars.js"></script>
<script type="text/javascript" src="/js/layer.js"
        tppabs="http://www.17sucai.com/preview/1268063/2018-10-23/Sunburn/js/layer.js"></script>
<script type="text/javascript" src="/js/api.js"></script>
<script type="text/javascript" src="/js/amazeui.datetimepicker.min.js"></script>
<script type="text/javascript" src="/js/picjs/fileinput.js"></script>
<script type="text/javascript" src="/js/picjs/exif.js"></script>
<script type="text/javascript" src="/js/picjs/image-clip.js"></script>
<script type="text/javascript" src="/js/aui-dialog.js"></script>
<script type="text/javascript" src="/js/layer-bq.js"></script>
<script type="text/javascript" src="/js/util/activ_util.js"></script>
<script type="text/javascript">
    //时间控件
    $('#datetimepicker1').datetimepicker({
        format: 'hh:ii:ss'
    });
    $('#datetimepicker2').datetimepicker({
        format: 'hh:ii:ss'
    });

    apiready = function () {
        api.parseTapmode();
    }
    var dialog = new auiDialog();
    var id = $(".id").val();
    var phone = $(".phone").val();

    $(".goblack").click(function () {
        $("#merchants").show();
        $(".iframe").hide();
    })

    $(".acvfile").click(function () {
        $("#merchants").hide();
        $(".iframe").show();

    })

    function wininit() {
        $("#aui-header").hide();
    }

    function goblack() {
        $(".goblack").click(function () {
            location.href = "douser";
        })
    }


    //点击更新按钮
    $(".subbtn").click(function () {
        $.ajax({
            url: "updatemerchants",
            type: "POST",
            dataType: "JSON",
            data: $("#merchants").serialize(),
            success: function (data) {
                if (data) {
                    dialog.alert({
                        title: "提示",
                        msg: "更新成功",
                        buttons: ['确定']
                    }, function (ret) {
                        if (ret) {
                            location.href = "douser";
                        }
                    })
                } else {
                    dialog.alert({
                        title: "提示",
                        msg: "更新失败",
                        buttons: ['确定']
                    }, function (ret) {
                        if (ret) {
                            location.href = "douserinfo?phone=" + $(".phone").val();
                        }
                    })
                }

            }, error: function (data) {
                dialog.alert({
                    title: "提示",
                    msg: "更新异常",
                    buttons: ['确定']
                }, function (ret) {
                    if (ret) {
                        location.href = "douserinfo?phone=" + $(".phone").val();
                    }
                })
            }
        })
    });
</script>

</body>
</html>
